<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>微信群发消息</title>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
  $(document).ready(function() {
    $('#tt').tabs({
      onSelect : function(title) {
        $('#tt .panel-body').css('width', 'auto');
      }
    });
    $(".tabs-wrap").css('width', '100%');
  });
</script>
</head>
<body style="overflow-x: hidden;">
	<t:formvalid formid="formobj" dialog="true" usePlugin="password"
		layout="table" tiptype="1" action="wxMassBillController.do?doUpdate">
		<input id="id" name="id" type="hidden" value="${wxMassBillPage.id }">
		<input id="createName" name="createName" type="hidden"
			value="${wxMassBillPage.createName }">
		<input id="createBy" name="createBy" type="hidden"
			value="${wxMassBillPage.createBy }">
		<input id="createDate" name="createDate" type="hidden"
			value="${wxMassBillPage.createDate }">
		<input id="updateName" name="updateName" type="hidden"
			value="${wxMassBillPage.updateName }">
		<input id="updateBy" name="updateBy" type="hidden"
			value="${wxMassBillPage.updateBy }">
		<input id="updateDate" name="updateDate" type="hidden"
			value="${wxMassBillPage.updateDate }">
		<input id="sysOrgCode" name="sysOrgCode" type="hidden"
			value="${wxMassBillPage.sysOrgCode }">
		<input id="sysCompanyCode" name="sysCompanyCode" type="hidden"
			value="${wxMassBillPage.sysCompanyCode }">
		<input id="accountId" name="accountId" type="hidden"
			value="${wxMassBillPage.accountId }">
		<input id="cardId" name="cardId" type="hidden">
		<input id="cardName" name="cardName" type="hidden">
		<input id="msgId" name="msgId" type="hidden">
		<input id="msgDataId" name="msgDataId" type="hidden">

		<table cellpadding="0" cellspacing="1" class="formtable">
			<tr>
				<td align="right"><label class="Validform_label">单号:</label></td>
				<td class="value"><input id="billNumber" name="billNumber"
					type="text" style="width: 150px" class="inputxt" datatype="*"
					value='${wxMassBillPage.billNumber}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">单号</label></td>

				<td align="right"><label class="Validform_label">消息类型:</label>
				</td>
				<td class="value"><t:dictSelect id="msgType" field="msgType"
						type="list" typeGroupCode="massmsgtype"
						defaultVal="${wxMassBillPage.msgType}" hasLabel="false"
						title="消息类型"></t:dictSelect> <span class="Validform_checktip"></span>
					<label class="Validform_label" style="display: none;">消息类型</label></td>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="Validform_label">群发内容:</label>
				</td>
				<td class="value" colspan=3>
					<div class="mass-content">
						<input id="templateId" name="templateId" type="hidden"
							value="${wxMassBillPage.templateId }"> <input
							id="mediaId" name="mediaId" type="hidden"
							value="${wxMassBillPage.mediaId }">

						<div class="text">
							<textarea id="textMsg" name="textMsg"
								style="width: 368px; height: 80px;" class="inputxt">${wxMassBillPage.textMsg }</textarea>
						</div>
						<div class="tpl">
							<input id="templateName" name="templateName" type="text"
								style="width: 150px" class="inputxt" placeholder="请选择消息模板"
								value="${wxMassBillPage.templateName }">
						</div>
						<div class="card">
							<input id="cardName" name="cardName" type="text"
								style="width: 150px" class="inputxt" placeholder="请选择微信卡券">
						</div>
					</div> <span class="Validform_checktip"></span> <label
					class="Validform_label" style="display: none;">群发内容</label>
				</td>
			</tr>

			<tr>
				<td align="right"><label class="Validform_label">发送给全部粉丝:</label>
				</td>
				<td class="value"><t:dictSelect field="isToAll" type="list"
						typeGroupCode="yesorno" defaultVal="${wxMassBillPage.isToAll}"
						hasLabel="false" title="发送给全部粉丝"></t:dictSelect> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">全部发送</label></td>

				<td align="right"><label class="Validform_label">判定为转载后继续发送:</label>
				</td>
				<td class="value"><t:dictSelect field="sendIgnoreReprint"
						type="list" typeGroupCode="yesorno"
						defaultVal="${wxMassBillPage.sendIgnoreReprint}" hasLabel="false"
						title="判定为转载后继续发送"></t:dictSelect> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">判定为转载后继续发送</label></td>
			</tr>

			<tr>
				<td align="right"><label class="Validform_label">发送状态:</label>
				</td>
				<td class="value"><input id="sendStatus" name="sendStatus"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.sendStatus}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">发送状态</label></td>

				<td align="right"><label class="Validform_label">失败信息:</label>
				</td>
				<td class="value"><input id="sendErrMsg" name="sendErrMsg"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.sendErrMsg}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">失败信息</label></td>
			</tr>

			<tr>
				<td align="right"><label class="Validform_label">粉丝数:</label></td>
				<td class="value"><input id="totalCount" name="totalCount"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.totalCount}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">粉丝数</label></td>

				<td align="right"><label class="Validform_label">过滤后粉丝数:</label>
				</td>
				<td class="value"><input id="filterCount" name="filterCount"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.filterCount}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">过滤后粉丝数</label></td>
			</tr>

			<tr>
				<td align="right"><label class="Validform_label">成功发送数:</label>
				</td>
				<td class="value"><input id="sentCount" name="sentCount"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.sentCount}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">成功发送数</label></td>

				<td align="right"><label class="Validform_label">失败数量:</label>
				</td>
				<td class="value"><input id="errorCount" name="errorCount"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.errorCount}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">失败数量</label></td>
			</tr>

			<%-- <tr>
				<td align="right"><label class="Validform_label">整体校验结果:</label>
				</td>
				<td class="value" colspan=3><input id="checkState" name="checkState"
					type="text" style="width: 150px" class="inputxt"
					value='${wxMassBillPage.checkState}' readonly> <span
					class="Validform_checktip"></span> <label class="Validform_label"
					style="display: none;">整体校验结果</label></td>
			</tr> --%>

			<tr>
				<td align="right"><label class="Validform_label">备注:</label></td>
				<td class="value" colspan=3><textarea id="remark" name="remark"
						type="text" style="width: 368px; height: 80px;" class="inputxt">${wxMassBillPage.remark}</textarea>
					<span class="Validform_checktip"></span> <label
					class="Validform_label" style="display: none;">备注</label></td>
			</tr>

		</table>

		<div style="width: auto; height: 200px;">
			<%-- 增加一个div，用于调节页面大小，否则默认太小 --%>
			<div style="width: 800px; height: 1px;"></div>
			<t:tabs id="tt" iframe="false" tabPosition="top" fit="false">
				<t:tab
					href="wxMassBillController.do?wxMassUsersList&id=${wxMassBillPage.id}"
					icon="icon-search" title="微信群发用户" id="wxMassUsers"></t:tab>
			</t:tabs>
		</div>
	</t:formvalid>

	<!-- 添加 附表明细 模版 -->
	<table style="display: none">
		<tbody id="add_wxMassUsers_table_template">
			<tr>
				<td align="center"><div style="width: 25px;" name="xh"></div></td>
				<td align="center"><input style="width: 20px;" type="checkbox"
					name="ck" /></td>
				<td align="left"><input name="wxMassUsersList[#index#].owner"
					type="hidden"></td>
				<td align="left"><input class="fansOpenId"
					name="wxMassUsersList[#index#].fansOpenId" maxlength="100"
					type="hidden"></td>

				<td align="left"><input
					name="wxMassUsersList[#index#].fansName" maxlength="100"
					type="text" class="inputxt fansName" style="width: 120px;"
					onclick="openFansSelectDlg(this)"> <label
					class="Validform_label" style="display: none;">粉丝名称</label></td>

			</tr>
		</tbody>
	</table>
</body>
<script
	src="webpage/com/gomore/wechat/module/message/mass/wxMassBill.js?v=${version}"></script>